from fdfs_client.client import Fdfs_client


if __name__ == "__main__":
    # 创建用来上传/下载/删除等操作的fdfs客户端连接对象
    client = Fdfs_client('client.conf')
    ret = client.upload_by_filename('/home/python/FlaskProject/app/static/news/images/cat.jpg')
    print(ret)
"""
{
    'Group name': 'group1',
    'Local file name': '/home/python/FlaskProject/app/static/news/images/cat.jpg',
    'Remote file_id': 'group1/M00/00/00/wKigm1vbAvWAQbwOAAAQ7colEzw717.jpg',
    'Status': 'Upload successed.',
    'Storage IP': '192.168.160.155',
    'Uploaded size': '4.00KB'
}

组名
本地路径
远程路径(即FastDFS文件存储系统保存的文件路径): 虚拟磁盘路径/数据两级目录/文件名
上传状态
仓库ip
文件大小
"""